import request from '@/utils/request'

export function getAllRoles(page, pagesize) {
  return request({
    url: '/sys/role',
    method: 'get',
    params: { page, pagesize }
  })
}
// 添加功能
export function addRole(data) {
  return request({
    url: '/sys/role',
    method: 'post',
    data
  })
}
// 通过id获取角色详情
export function getDetailsById(id) {
  return request({
    url: `/sys/role/${id}`,
    method: 'get'

  })
}
// 通过id更新角色
export function updateById(data) {
  return request({
    url: `/sys/role/${data.id}`,
    method: 'put',
    data
  })
}
// 通过id删除角色
export function deleteById(id) {
  return request({
    url: `/sys/role/${id}`,
    method: 'delete'

  })
}
